package sb.de.advanceShopper.model;

public class Shop {

	private final long id;

	private final String name;

	private final int city;

	private final double longitude;

	private final double latitude;

	private final String description;

	public Shop(long index, String name, int city, double longitude,
			double latitude, String description) {
		this.id = index;
		this.name = name;
		this.city = city;
		this.longitude = longitude;
		this.latitude = latitude;
		this.description = description;
	}

	public long getId() {
		return id;
	}

	public String getName() {
		return name;
	}

	public int getCity() {
		return city;
	}

	public double getLatitude() {
		return latitude;
	}

	public double getLongitude() {
		return longitude;
	}

	public String getDescription() {
		return description;
	}

	@Override
	public String toString() {
		return "#" + id + " Name:" + name + " Latitude:" + latitude
				+ " Longitude:" + longitude + " Description:" + description
				+ ".";
	}

	@Override
	public boolean equals(Object o) {
		if (o == null) {
			return false;
		} else if (this == o) {
			return true;
		} else if (o instanceof Shop) {
			Shop tmpShop = (Shop) o;
			// TODO abs lat&long
			if (tmpShop.name.equals(name) && tmpShop.city == city
					&& tmpShop.latitude == latitude
					&& tmpShop.longitude == longitude) {
				return true;
			}
		}
		return false;
	}
}
